package com.yonyou.ucf.mdf.query.configuration;

import com.yonyou.ucf.mdf.query.configuration.QuerySchemaExecutorAutoConfiguration;
import com.yonyou.ucf.mdf.query.core.QueryPartitionBuilder;
import com.yonyou.ucf.mdf.query.core.executor.IsvRemoteQueryExecutor;
import com.yonyou.ucf.mdf.query.core.executor.RemoteQueryExecutor;
import com.yonyou.ucf.mdf.query.core.service.IsvDefaultQueryPartitionBuilder;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;

/**
 * @Author: zhuyjh
 * @Date: 2024/8/6 15:37
 */
@AutoConfigureBefore(QuerySchemaExecutorAutoConfiguration.class)
public class IsvQuerySchemaExecutorAutoConfiguration {
    @Bean
    @ConditionalOnMissingBean
    public RemoteQueryExecutor remoteExecutor() {
        return new IsvRemoteQueryExecutor();
    }
    @Bean(name = {"defaultQueryPartitionBuilder"})
    @ConditionalOnMissingBean
    public QueryPartitionBuilder queryPartitionBuilder() {
        return new IsvDefaultQueryPartitionBuilder();
    }
}